package com.ls.fw.mvc.springmvc.test;

import java.util.Date;

import javax.validation.constraints.NotNull;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ls.fw.mvc.springmvc.support.convert.CustomDateSerializer;

public class UserModel {
    private Integer id;
     
    private String username;
     
    private String content;
    
    private Date birthday;
    
    @NotNull(message="{id.empty}",groups={First.class})
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
     
    @NotNull(message="{username.empty}",groups = {First.class, Second.class})
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    @NotNull(message="{content.empty}",groups = {First.class, Second.class})
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    
    @DateTimeFormat(pattern="yyyy-MM-dd")  
    @JsonSerialize(using=CustomDateSerializer.class)  
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
}